|
This is a general outline of how to use concurrencyMode in XPages.
|
The core control "Display Errors" (plural) along with concurrencyMode allows you display an error if two or more users attempt to edit the same document in the same XPage session. This works with XPages using the Notes and Web Clients.
Example Steps:
- Create a new application on your Domino server
- Create a new form with one or more fields
- Create a new view with a selection formula for the new form
- Create a column for each field on the form
- Create a new XPage with a View control
- Select the Notes view for the data source along with the individual view columns
- Create a new XPage for document viewing
- Add a core control edit box for every field you would like to edit
- Bind each field to the Notes form field
- Add the "Display Errors" (plural) core control to this XPage
- Add a button to the XPage to save changes
- Go the XPage "All Properties" and select "data->data->[defined data source for XPage]->concurrencyMode" and set mode to fail
- Save the XPage
- Go back to the view XPage click on the individual columns in the view control
- For the column display properties select to "Show values in this column as links" and set "Document open mode" as Edit
- Again with each column selected for the onClick Event add an action to open the document XPage in edit mode
- Create at least one new Notes document based on the Notes form
- Using Notes client or web browser open the view XPage
- Click on the link to place that document in edit mode
- Change a value
- Prior to saving using another machine repeat steps 18 - 20 on same document
- Click save on both machines
Result you will a message similar to the following:
Example Database:
(See attached file: xpageconcurrencytest.zip)
Extract and place in your ..\Domino\data directory. Sign the database with the server id and add a Manager user to ACL of database for testing.
Note: Display Errors catches any and all errors on a XPage |